!{include file='common/iheader.htm'}
<div class="wrap main_content" id="user_form">
	<div id="about_dakuangye">
		!{w name='article.single' tpl='login_desc' alias='user_illustrate'}
	</div>
	<form method="post" id="login_form">
		<div class="form_item">
			<strong>用户昵称</strong>
			<div><input type="text" class="text_input" name="user_name" value="!{$user.user_name}"/></div>
		</div>
		<div class="form_item">
			<strong>电子邮箱</strong>
			<div><input type="text" class="text_input" name="email" value="!{$user.email}"/></div>
		</div>
		<div class="form_item">
			<strong>用户密码</strong>
			<div><input type="password" id="password" class="text_input" name="password"/></div>
		</div>
		<div class="form_item">
			<strong>再次输入密码</strong>
			<div><input type="password" class="text_input" name="confirm_password"/></div>
		</div>
		<div class="form_item btn_item">
			<input type="hidden" name="return_url" value="!{$return_url}"/>
			<input type="submit" value="注册" class="button submit_btn"/>
		</div>
		<div class="form_item img_text_link">
			<b>三方登录</b>
			<a href="#"><img src="!{res file='images/icon_sina.png'}"/>新浪微博</a>
			<a href="#"><img src="!{res file='images/icon_qq_qq.png'}"/>QQ</a>
			<a href="#"><img src="!{res file='images/icon_qq.png'}"/>腾讯微博</a>
		</div>
		!{if $error}
		<div class="error red">!{$error}</div>
		!{/if}
	</form>
</div>
<script src="!{res file='js/jquery_plus/jquery.validate.min.js'}"></script>
<script>
	$(function(){
		$('#login_form').validate({
			rules : {
				user_name : {
					required : true,
					minlength : 4
				},
				email : {
					email : true,
					required : true
				},
				password : {
					required : true,
					minlength : 5
				},
				confirm_password: {
					required : true,
					minlength : 5,
					equalTo: "#password"
				}
			},
			messages: {
				user_name : {
					required : '用户昵称不能为空！',
					minlength : '用户昵称至少需要5个字符！'
				},
				email : {
					email : '邮箱格式不正确！',
					required : '邮箱不能为空'
				},
				password : {
					required : '密码不能为空！',
					minlength : '密码长度至少需要5个字符！'
				},
				confirm_password: {
					required : '请再次填写密码！',
					minlength : '密码长度至少需要5个字符！',
					equalTo : '两次输入密码不一致！'
				}
			},
			errorPlacement: function(error, element) {
				var strong = $(element).parents('.form_item').find('strong');
				strong.find('span').remove();
				strong.append('<span class="red">' + error.html() + '</span>');
			},
			success : function(label,element){
				var strong = $(element).parents('.form_item').find('span').remove();
			}
		});
	})
</script>
!{include file='common/footer.htm'}